import publicForm from "@/components/public/el-form.vue"; //弹框form

import formJs from "./regexDetail.js"; //新增弹框配置项
import FormLyout from '@/components/commonPublic/fromLayout.vue'
import actions from "@/actions";
import {
  
    getCheckitemsByFid, //详情


} from "@/api/request.js";
export default {
   
    data() {
        return {
            visible: "",
            primaryInfo:null,
            loading:false,
            title: null,
            isLock: false,

            btnStatus: [],
            dialogHeight: null,
            activeIndex: "1",

            currntData: null,
            dataInfo: null,
            startDates: null,
            treeData: [], //材料种类
            formData: {
                fId: "", //主键id
                fChecktype: "", //树状图类型
                fItemno: "", //标准代号
                fItemname: "", //标准名称
                fItemvalue: "", //树状图类型id
                fNote: "", //备注
                userId: "", //当前登录用户id
                userName: "", //当前登录用户姓名
            },
            formObj: formJs.formObj,
            formDatafileList: [], //工作计划资料
            btnShow: true,
            currentDetail: null,
            selected: [],
            fCompanyids: null
        };
    },
    components: {
        publicForm,
        FormLyout
    },
    watch: {
        

    },
   
    mounted() {
        this.primaryInfo = JSON.parse(sessionStorage.getItem("GxEmbedded_primaryInfo"))
        this.statusNum=this.primaryInfo.status;
        actions.onGlobalStateChange((state, prev) => {
            var data = prev.currentUser.projects;
            this.userInfo = prev.currentUser
        }, true);
        
          if (this.statusNum == 7) { //查看
            this.getDetail({
                fId: this.primaryInfo.data.fId
            })
            this.formObj.map((item) => {
                item.disabled = true;
            });
        }
      
    },
    methods: {
        
        handleSelect(key) {
            this.activeIndex = key;
        },
      

      
   
        // 详情
        getDetail(obj) {
            this.loading=true;
            getCheckitemsByFid(obj).then((res) => {
                if (res.errcode == 0) {
                    this.loading=false;
                    var data = res.data.lrCheckCheckitems
                    this.formData = data;
                }else {
                    this.loading=false;
                    this.$message.error(res.msg);
                }
            });
        },

 
    },
};